{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Example training/test a model with pre-trained BYOL-A\n",
    "\n",
    "The following will run on the #2 split of the CirCor dataset.\n",
    "\n",
    "- We set up the necessary files for BYOL-A first.\n",
    "- We use a utility script in this example.\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "/lab/m2d/app/circor/evar\n",
      "Cloning into 'byol-a'...\n",
      "remote: Enumerating objects: 127, done.\u001b[K\n",
      "remote: Counting objects: 100% (73/73), done.\u001b[K\n",
      "remote: Compressing objects: 100% (46/46), done.\u001b[K\n",
      "remote: Total 127 (delta 44), reused 42 (delta 27), pack-reused 54\u001b[K\n",
      "Receiving objects: 100% (127/127), 50.51 MiB | 11.84 MiB/s, done.\n",
      "Resolving deltas: 100% (53/53), done.\n"
     ]
    }
   ],
   "source": [
    "%cd evar\n",
    "\n",
    "! (cd external && git clone https://github.com/nttcslab/byol-a.git)\n",
    "! (cd external && mv byol-a byol_a)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Repeating 1 times...\n",
      "CUDA_VISIBLE_DEVICES=2 python circor_eval.py config/byola.yaml circor2 weight_file=external/byol_a/pretrained_weights/AudioNTT2020-BYOLA-64x96d2048.pth --lr=0.001 --freq_mask 20 --time_mask 50 -mixup 0.0 --rrc False --epochs 50 --warmup_epochs 5 --seed 43 --batch_size 256\n",
      "/home/ntt/anaconda3/envs/ar/lib/python3.9/site-packages/nnAudio/Spectrogram.py:4: Warning: importing Spectrogram subpackage will be deprecated soon. You should import the feature extractor from the feature subpackage. See actual documentation.\n",
      "  warnings.warn(\n",
      "weight_file=external/byol_a/pretrained_weights/AudioNTT2020-BYOLA-64x96d2048.pth\n",
      "+task_metadata=evar/metadata/circor2.csv,+task_data=work/16k/circor2,+unit_samples=80000\n",
      "Logging to logs/circor2_ar_byola.AR_BYOLA_8a96cef9/log.txt\n",
      "{'audio_repr': 'ar_byola.AR_BYOLA', 'weight_file': 'external/byol_a/pretrained_weights/AudioNTT2020-BYOLA-64x96d2048.pth', 'feature_d': 2048, 'sample_rate': 16000, 'n_fft': 1024, 'window_size': 1024, 'hop_size': 160, 'n_mels': 64, 'f_min': 60, 'f_max': 7800, 'temporal_pooling_type': 'mean_max', 'batch_size': 256, 'lr_lineareval': 0.0003, 'report_per_epochs': 20, 'early_stop_epochs': 20, 'warmup_epochs': 5, 'mixup': 0.0, 'ft_bs': 256, 'ft_lr': 0.001, 'ft_early_stop_epochs': -1, 'ft_epochs': 50, 'ft_freq_mask': 20, 'ft_time_mask': 50, 'ft_rrc': False, 'name': '', 'task_metadata': 'evar/metadata/circor2.csv', 'task_data': 'work/16k/circor2', 'unit_samples': 80000, 'id': 'circor2_ar_byola.AR_BYOLA_8a96cef9', 'training_mask': 0.0, 'optim': 'sgd', 'unit_sec': None, 'data_path': 'work', 'runtime_cfg': {'lr': 0.001, 'seed': 43, 'hidden': [], 'mixup': 0.0, 'bs': 256, 'freq_mask': 20, 'time_mask': 50, 'rrc': False, 'epochs': 50, 'early_stop_epochs': -1, 'n_class': 3, 'id': 'c8e723cc'}}\n",
      "\n",
      "🚀 Start fine-tuning  with logging in logs/circor2_ar_byola.AR_BYOLA_8a96cef9\n",
      "Train:17986, valid:2570, test:6805, multi label:False, balanced:False\n",
      " using network pretrained weight: AudioNTT2020-BYOLA-64x96d2048.pth\n",
      "['features.0.weight', 'features.0.bias', 'features.1.weight', 'features.1.bias', 'features.1.running_mean', 'features.1.running_var', 'features.1.num_batches_tracked', 'features.4.weight', 'features.4.bias', 'features.5.weight', 'features.5.bias', 'features.5.running_mean', 'features.5.running_var', 'features.5.num_batches_tracked', 'features.8.weight', 'features.8.bias', 'features.9.weight', 'features.9.bias', 'features.9.running_mean', 'features.9.running_var', 'features.9.num_batches_tracked', 'fc.0.weight', 'fc.0.bias', 'fc.3.weight', 'fc.3.bias']\n",
      "<All keys matched successfully>\n",
      " using spectrogram norimalization stats: [-10.886687   5.195151]\n",
      "2048 [] 3\n",
      "Backbone representation:\n",
      "Total number of parameters: 5,321,856 (trainable 5,321,856)\n",
      "Trainable parameters: ['body.features.0.weight', 'body.features.0.bias', 'body.features.1.weight', 'body.features.1.bias', 'body.features.4.weight', 'body.features.4.bias', 'body.features.5.weight', 'body.features.5.bias', 'body.features.8.weight', 'body.features.8.bias'] ...\n",
      "Others are frozen such as: [] \n",
      "Head:\n",
      "Total number of parameters: 6,147 (trainable 6,147)\n",
      "Trainable parameters: ['mlp.mlp.0.weight', 'mlp.mlp.0.bias']\n",
      "Others are frozen such as: [] \n",
      "Head = TaskHead(\n",
      "  (norm): BatchNorm1d(2048, eps=1e-05, momentum=0.1, affine=False, track_running_stats=True)\n",
      "  (mlp): MLP(\n",
      "    (mlp): Sequential(\n",
      "      (0): Linear(in_features=2048, out_features=3, bias=True)\n",
      "    )\n",
      "  )\n",
      ")\n",
      "Using CrossEntropyLoss(weight=[0.43989532 1.75558809 6.36447275]), eval_acc, and SGD (\n",
      "Parameter Group 0\n",
      "    dampening: 0\n",
      "    differentiable: False\n",
      "    foreach: None\n",
      "    initial_lr: 0.001\n",
      "    lr: 0\n",
      "    maximize: False\n",
      "    momentum: 0.9\n",
      "    nesterov: False\n",
      "    weight_decay: 0\n",
      ")\n",
      " using mixup with alpha=0.0\n",
      " using SpecAugmentation with 20, 50.\n",
      "Epoch [0] iter: 0/71, elapsed: 2.985s, lr: 0.00000000 loss: 1.06432497\n",
      "Epoch [0] iter: 10/71, elapsed: 2.045s, lr: 0.00002817 loss: 1.04325551\n",
      "Epoch [0] iter: 20/71, elapsed: 2.270s, lr: 0.00005634 loss: 1.09490238\n",
      "Epoch [0] iter: 30/71, elapsed: 2.281s, lr: 0.00008451 loss: 1.15089712\n",
      "Epoch [0] iter: 40/71, elapsed: 3.005s, lr: 0.00011268 loss: 1.05979627\n",
      "Epoch [0] iter: 50/71, elapsed: 2.261s, lr: 0.00014085 loss: 1.18121125\n",
      "Epoch [0] iter: 60/71, elapsed: 2.259s, lr: 0.00016901 loss: 1.00292368\n",
      "Epoch [0] iter: 70/71, elapsed: 2.283s, lr: 0.00019718 loss: 1.05213356\n",
      "validating\n",
      "Saved weight as logs/circor2_ar_byola.AR_BYOLA_8a96cef9/weights_ep0it70-0.48911_loss1.0521.pth\n",
      "circor2_ar_byola.AR_BYOLA_8a96cef9-lr001fm20tm50s43 | epoch/iter 0/70: val acc: 0.48911, loss: 1.05213, best: 0.48911@0\n",
      "Epoch [1] iter: 0/71, elapsed: 7.630s, lr: 0.00020000 loss: 1.09826809\n",
      "Epoch [1] iter: 10/71, elapsed: 2.383s, lr: 0.00022817 loss: 1.04276852\n",
      "Epoch [1] iter: 20/71, elapsed: 2.245s, lr: 0.00025634 loss: 1.03376049\n",
      "Epoch [1] iter: 30/71, elapsed: 2.283s, lr: 0.00028451 loss: 1.07438460\n",
      "Epoch [1] iter: 40/71, elapsed: 2.797s, lr: 0.00031268 loss: 1.15060828\n",
      "Epoch [1] iter: 50/71, elapsed: 2.160s, lr: 0.00034085 loss: 0.90619522\n",
      "Epoch [1] iter: 60/71, elapsed: 2.259s, lr: 0.00036901 loss: 1.05728354\n",
      "Epoch [1] iter: 70/71, elapsed: 2.224s, lr: 0.00039718 loss: 1.07736821\n",
      "validating\n",
      "circor2_ar_byola.AR_BYOLA_8a96cef9-lr001fm20tm50s43 | epoch/iter 1/70: val acc: 0.45292, loss: 1.07737, best: 0.48911@0\n",
      "Epoch [2] iter: 0/71, elapsed: 7.585s, lr: 0.00040000 loss: 1.13425243\n",
      "Epoch [2] iter: 10/71, elapsed: 2.322s, lr: 0.00042817 loss: 0.94025279\n",
      "Epoch [2] iter: 20/71, elapsed: 2.232s, lr: 0.00045634 loss: 1.01971952\n",
      "Epoch [2] iter: 30/71, elapsed: 2.288s, lr: 0.00048451 loss: 0.99673894\n",
      "Epoch [2] iter: 40/71, elapsed: 2.834s, lr: 0.00051268 loss: 0.97588549\n",
      "Epoch [2] iter: 50/71, elapsed: 2.363s, lr: 0.00054085 loss: 0.97882673\n",
      "Epoch [2] iter: 60/71, elapsed: 2.285s, lr: 0.00056901 loss: 0.89308855\n",
      "Epoch [2] iter: 70/71, elapsed: 2.214s, lr: 0.00059718 loss: 0.84171814\n",
      "validating\n",
      "circor2_ar_byola.AR_BYOLA_8a96cef9-lr001fm20tm50s43 | epoch/iter 2/70: val acc: 0.33074, loss: 0.84172, best: 0.48911@0\n",
      "Epoch [3] iter: 0/71, elapsed: 7.764s, lr: 0.00060000 loss: 0.84431012\n",
      "Epoch [3] iter: 10/71, elapsed: 2.267s, lr: 0.00062817 loss: 0.89247351\n",
      "Epoch [3] iter: 20/71, elapsed: 2.337s, lr: 0.00065634 loss: 0.89539427\n",
      "Epoch [3] iter: 30/71, elapsed: 2.306s, lr: 0.00068451 loss: 0.94506230\n",
      "Epoch [3] iter: 40/71, elapsed: 2.980s, lr: 0.00071268 loss: 0.87939461\n",
      "Epoch [3] iter: 50/71, elapsed: 2.266s, lr: 0.00074085 loss: 0.92667045\n",
      "Epoch [3] iter: 60/71, elapsed: 2.239s, lr: 0.00076901 loss: 0.89798496\n",
      "Epoch [3] iter: 70/71, elapsed: 2.271s, lr: 0.00079718 loss: 0.99652831\n",
      "validating\n",
      "circor2_ar_byola.AR_BYOLA_8a96cef9-lr001fm20tm50s43 | epoch/iter 3/70: val acc: 0.40350, loss: 0.99653, best: 0.48911@0\n",
      "Epoch [4] iter: 0/71, elapsed: 7.641s, lr: 0.00080000 loss: 0.98988958\n",
      "Epoch [4] iter: 10/71, elapsed: 2.142s, lr: 0.00082817 loss: 1.09017741\n",
      "Epoch [4] iter: 20/71, elapsed: 2.183s, lr: 0.00085634 loss: 0.92170403\n",
      "Epoch [4] iter: 30/71, elapsed: 2.237s, lr: 0.00088451 loss: 0.89887351\n",
      "Epoch [4] iter: 40/71, elapsed: 2.890s, lr: 0.00091268 loss: 0.96662724\n",
      "Epoch [4] iter: 50/71, elapsed: 2.251s, lr: 0.00094085 loss: 0.93248328\n",
      "Epoch [4] iter: 60/71, elapsed: 2.243s, lr: 0.00096901 loss: 0.93106357\n",
      "Epoch [4] iter: 70/71, elapsed: 2.223s, lr: 0.00099718 loss: 0.78046016\n",
      "validating\n",
      "circor2_ar_byola.AR_BYOLA_8a96cef9-lr001fm20tm50s43 | epoch/iter 4/70: val acc: 0.42840, loss: 0.78046, best: 0.48911@0\n",
      "Epoch [5] iter: 0/71, elapsed: 7.687s, lr: 0.00097553 loss: 1.00650897\n",
      "Epoch [5] iter: 10/71, elapsed: 2.100s, lr: 0.00097414 loss: 0.90792624\n",
      "Epoch [5] iter: 20/71, elapsed: 2.377s, lr: 0.00097272 loss: 1.02537281\n",
      "Epoch [5] iter: 30/71, elapsed: 2.252s, lr: 0.00097126 loss: 0.97524379\n",
      "Epoch [5] iter: 40/71, elapsed: 2.996s, lr: 0.00096977 loss: 0.95277404\n",
      "Epoch [5] iter: 50/71, elapsed: 2.234s, lr: 0.00096823 loss: 0.92454535\n",
      "Epoch [5] iter: 60/71, elapsed: 2.245s, lr: 0.00096666 loss: 1.07060369\n",
      "Epoch [5] iter: 70/71, elapsed: 2.209s, lr: 0.00096505 loss: 1.01310407\n",
      "validating\n",
      "circor2_ar_byola.AR_BYOLA_8a96cef9-lr001fm20tm50s43 | epoch/iter 5/70: val acc: 0.42879, loss: 1.01310, best: 0.48911@0\n",
      "Epoch [6] iter: 0/71, elapsed: 7.678s, lr: 0.00096489 loss: 0.82470621\n",
      "Epoch [6] iter: 10/71, elapsed: 2.170s, lr: 0.00096324 loss: 0.94455393\n",
      "Epoch [6] iter: 20/71, elapsed: 2.188s, lr: 0.00096156 loss: 0.93923650\n",
      "Epoch [6] iter: 30/71, elapsed: 2.265s, lr: 0.00095984 loss: 1.09151713\n",
      "Epoch [6] iter: 40/71, elapsed: 2.863s, lr: 0.00095809 loss: 0.98482850\n",
      "Epoch [6] iter: 50/71, elapsed: 2.252s, lr: 0.00095630 loss: 0.91473419\n",
      "Epoch [6] iter: 60/71, elapsed: 2.242s, lr: 0.00095447 loss: 0.94456292\n",
      "Epoch [6] iter: 70/71, elapsed: 2.272s, lr: 0.00095261 loss: 1.03844936\n",
      "validating\n",
      "Saved weight as logs/circor2_ar_byola.AR_BYOLA_8a96cef9/weights_ep6it70-0.56342_loss1.0384.pth\n",
      "circor2_ar_byola.AR_BYOLA_8a96cef9-lr001fm20tm50s43 | epoch/iter 6/70: val acc: 0.56342, loss: 1.03845, best: 0.56342@6\n",
      "Epoch [7] iter: 0/71, elapsed: 7.691s, lr: 0.00095242 loss: 1.10562571\n",
      "Epoch [7] iter: 10/71, elapsed: 2.259s, lr: 0.00095052 loss: 1.02768275\n",
      "Epoch [7] iter: 20/71, elapsed: 2.228s, lr: 0.00094858 loss: 0.94175879\n",
      "Epoch [7] iter: 30/71, elapsed: 2.298s, lr: 0.00094661 loss: 1.00811663\n",
      "Epoch [7] iter: 40/71, elapsed: 2.988s, lr: 0.00094460 loss: 0.99957639\n",
      "Epoch [7] iter: 50/71, elapsed: 2.273s, lr: 0.00094256 loss: 0.78767786\n",
      "Epoch [7] iter: 60/71, elapsed: 2.272s, lr: 0.00094048 loss: 1.13280166\n",
      "Epoch [7] iter: 70/71, elapsed: 2.235s, lr: 0.00093837 loss: 0.91837575\n",
      "validating\n",
      "Saved weight as logs/circor2_ar_byola.AR_BYOLA_8a96cef9/weights_ep7it70-0.61829_loss0.9184.pth\n",
      "circor2_ar_byola.AR_BYOLA_8a96cef9-lr001fm20tm50s43 | epoch/iter 7/70: val acc: 0.61829, loss: 0.91838, best: 0.61829@7\n",
      "Epoch [8] iter: 0/71, elapsed: 7.687s, lr: 0.00093816 loss: 0.96452416\n",
      "Epoch [8] iter: 10/71, elapsed: 2.266s, lr: 0.00093601 loss: 0.93427996\n",
      "Epoch [8] iter: 20/71, elapsed: 2.274s, lr: 0.00093383 loss: 0.84214655\n",
      "Epoch [8] iter: 30/71, elapsed: 2.268s, lr: 0.00093161 loss: 0.97963445\n",
      "Epoch [8] iter: 40/71, elapsed: 2.913s, lr: 0.00092936 loss: 1.04191486\n",
      "Epoch [8] iter: 50/71, elapsed: 2.258s, lr: 0.00092708 loss: 0.89103702\n",
      "Epoch [8] iter: 60/71, elapsed: 2.282s, lr: 0.00092476 loss: 0.97655136\n",
      "Epoch [8] iter: 70/71, elapsed: 2.230s, lr: 0.00092241 loss: 0.89223119\n",
      "validating\n",
      "Saved weight as logs/circor2_ar_byola.AR_BYOLA_8a96cef9/weights_ep8it70-0.64475_loss0.8922.pth\n",
      "circor2_ar_byola.AR_BYOLA_8a96cef9-lr001fm20tm50s43 | epoch/iter 8/70: val acc: 0.64475, loss: 0.89223, best: 0.64475@8\n",
      "Epoch [9] iter: 0/71, elapsed: 7.813s, lr: 0.00092217 loss: 0.88973535\n",
      "Epoch [9] iter: 10/71, elapsed: 2.321s, lr: 0.00091978 loss: 0.96256965\n",
      "Epoch [9] iter: 20/71, elapsed: 2.273s, lr: 0.00091736 loss: 1.08470140\n",
      "Epoch [9] iter: 30/71, elapsed: 2.262s, lr: 0.00091491 loss: 0.82969243\n",
      "Epoch [9] iter: 40/71, elapsed: 3.006s, lr: 0.00091243 loss: 0.88898398\n",
      "Epoch [9] iter: 50/71, elapsed: 2.204s, lr: 0.00090991 loss: 0.96107954\n",
      "Epoch [9] iter: 60/71, elapsed: 2.235s, lr: 0.00090736 loss: 0.86156012\n",
      "Epoch [9] iter: 70/71, elapsed: 2.197s, lr: 0.00090478 loss: 1.10391715\n",
      "validating\n",
      "circor2_ar_byola.AR_BYOLA_8a96cef9-lr001fm20tm50s43 | epoch/iter 9/70: val acc: 0.30506, loss: 1.10392, best: 0.64475@8\n",
      "Epoch [10] iter: 0/71, elapsed: 7.643s, lr: 0.00090452 loss: 0.95080684\n",
      "Epoch [10] iter: 10/71, elapsed: 2.291s, lr: 0.00090190 loss: 0.96702572\n",
      "Epoch [10] iter: 20/71, elapsed: 2.194s, lr: 0.00089925 loss: 0.98182505\n",
      "Epoch [10] iter: 30/71, elapsed: 2.218s, lr: 0.00089657 loss: 0.92846204\n",
      "Epoch [10] iter: 40/71, elapsed: 2.814s, lr: 0.00089386 loss: 1.04896140\n",
      "Epoch [10] iter: 50/71, elapsed: 2.291s, lr: 0.00089112 loss: 0.85116807\n",
      "Epoch [10] iter: 60/71, elapsed: 2.275s, lr: 0.00088835 loss: 0.91567111\n",
      "Epoch [10] iter: 70/71, elapsed: 2.207s, lr: 0.00088555 loss: 1.08503698\n",
      "validating\n",
      "circor2_ar_byola.AR_BYOLA_8a96cef9-lr001fm20tm50s43 | epoch/iter 10/70: val acc: 0.60078, loss: 1.08504, best: 0.64475@8\n",
      "Epoch [11] iter: 0/71, elapsed: 7.722s, lr: 0.00088527 loss: 0.90986733\n",
      "Epoch [11] iter: 10/71, elapsed: 2.279s, lr: 0.00088243 loss: 1.04102758\n",
      "Epoch [11] iter: 20/71, elapsed: 2.156s, lr: 0.00087957 loss: 0.96045215\n",
      "Epoch [11] iter: 30/71, elapsed: 2.338s, lr: 0.00087667 loss: 1.02902906\n",
      "Epoch [11] iter: 40/71, elapsed: 2.808s, lr: 0.00087375 loss: 0.89639903\n",
      "Epoch [11] iter: 50/71, elapsed: 2.254s, lr: 0.00087079 loss: 0.99269001\n",
      "Epoch [11] iter: 60/71, elapsed: 2.181s, lr: 0.00086781 loss: 0.95118515\n",
      "Epoch [11] iter: 70/71, elapsed: 2.212s, lr: 0.00086480 loss: 0.76775886\n",
      "validating\n",
      "circor2_ar_byola.AR_BYOLA_8a96cef9-lr001fm20tm50s43 | epoch/iter 11/70: val acc: 0.62412, loss: 0.76776, best: 0.64475@8\n",
      "Epoch [12] iter: 0/71, elapsed: 8.071s, lr: 0.00086450 loss: 0.78908962\n",
      "Epoch [12] iter: 10/71, elapsed: 2.157s, lr: 0.00086145 loss: 0.96531655\n",
      "Epoch [12] iter: 20/71, elapsed: 2.408s, lr: 0.00085838 loss: 0.88973224\n",
      "Epoch [12] iter: 30/71, elapsed: 2.269s, lr: 0.00085528 loss: 0.82097136\n",
      "Epoch [12] iter: 40/71, elapsed: 2.974s, lr: 0.00085216 loss: 0.95264643\n",
      "Epoch [12] iter: 50/71, elapsed: 2.290s, lr: 0.00084900 loss: 0.88820883\n",
      "Epoch [12] iter: 60/71, elapsed: 2.208s, lr: 0.00084582 loss: 0.93515368\n",
      "Epoch [12] iter: 70/71, elapsed: 2.233s, lr: 0.00084261 loss: 0.81930300\n",
      "validating\n",
      "circor2_ar_byola.AR_BYOLA_8a96cef9-lr001fm20tm50s43 | epoch/iter 12/70: val acc: 0.37549, loss: 0.81930, best: 0.64475@8\n",
      "Epoch [13] iter: 0/71, elapsed: 7.773s, lr: 0.00084229 loss: 0.81073032\n",
      "Epoch [13] iter: 10/71, elapsed: 2.224s, lr: 0.00083905 loss: 1.10371208\n",
      "Epoch [13] iter: 20/71, elapsed: 2.126s, lr: 0.00083579 loss: 1.03076195\n",
      "Epoch [13] iter: 30/71, elapsed: 2.274s, lr: 0.00083249 loss: 1.01930972\n",
      "Epoch [13] iter: 40/71, elapsed: 2.891s, lr: 0.00082918 loss: 0.85681580\n",
      "Epoch [13] iter: 50/71, elapsed: 2.255s, lr: 0.00082583 loss: 0.79919189\n",
      "Epoch [13] iter: 60/71, elapsed: 2.228s, lr: 0.00082246 loss: 0.85106354\n",
      "Epoch [13] iter: 70/71, elapsed: 2.289s, lr: 0.00081907 loss: 0.79767890\n",
      "validating\n",
      "circor2_ar_byola.AR_BYOLA_8a96cef9-lr001fm20tm50s43 | epoch/iter 13/70: val acc: 0.54358, loss: 0.79768, best: 0.64475@8\n",
      "Epoch [14] iter: 0/71, elapsed: 7.922s, lr: 0.00081873 loss: 0.87917053\n",
      "Epoch [14] iter: 10/71, elapsed: 2.199s, lr: 0.00081531 loss: 0.96494363\n",
      "Epoch [14] iter: 20/71, elapsed: 2.312s, lr: 0.00081186 loss: 0.87569707\n",
      "Epoch [14] iter: 30/71, elapsed: 2.305s, lr: 0.00080839 loss: 0.93259216\n",
      "Epoch [14] iter: 40/71, elapsed: 2.888s, lr: 0.00080490 loss: 0.85131395\n",
      "Epoch [14] iter: 50/71, elapsed: 2.253s, lr: 0.00080138 loss: 0.88546433\n",
      "Epoch [14] iter: 60/71, elapsed: 2.241s, lr: 0.00079784 loss: 1.06124881\n",
      "Epoch [14] iter: 70/71, elapsed: 2.206s, lr: 0.00079427 loss: 0.72195304\n",
      "validating\n",
      "circor2_ar_byola.AR_BYOLA_8a96cef9-lr001fm20tm50s43 | epoch/iter 14/70: val acc: 0.51284, loss: 0.72195, best: 0.64475@8\n",
      "Epoch [15] iter: 0/71, elapsed: 7.640s, lr: 0.00079391 loss: 0.93561265\n",
      "Epoch [15] iter: 10/71, elapsed: 2.375s, lr: 0.00079032 loss: 0.90443111\n",
      "Epoch [15] iter: 20/71, elapsed: 2.117s, lr: 0.00078671 loss: 0.91578749\n",
      "Epoch [15] iter: 30/71, elapsed: 2.293s, lr: 0.00078307 loss: 0.89624922\n",
      "Epoch [15] iter: 40/71, elapsed: 2.841s, lr: 0.00077941 loss: 1.18187233\n",
      "Epoch [15] iter: 50/71, elapsed: 2.206s, lr: 0.00077573 loss: 0.94383743\n",
      "Epoch [15] iter: 60/71, elapsed: 2.224s, lr: 0.00077203 loss: 0.94461716\n",
      "Epoch [15] iter: 70/71, elapsed: 2.196s, lr: 0.00076831 loss: 0.87925102\n",
      "validating\n",
      "circor2_ar_byola.AR_BYOLA_8a96cef9-lr001fm20tm50s43 | epoch/iter 15/70: val acc: 0.42918, loss: 0.87925, best: 0.64475@8\n",
      "Epoch [16] iter: 0/71, elapsed: 7.821s, lr: 0.00076794 loss: 1.01701725\n",
      "Epoch [16] iter: 10/71, elapsed: 2.291s, lr: 0.00076419 loss: 0.95668467\n",
      "Epoch [16] iter: 20/71, elapsed: 2.162s, lr: 0.00076042 loss: 0.84680973\n",
      "Epoch [16] iter: 30/71, elapsed: 2.224s, lr: 0.00075664 loss: 0.89150732\n",
      "Epoch [16] iter: 40/71, elapsed: 2.905s, lr: 0.00075283 loss: 0.98191079\n",
      "Epoch [16] iter: 50/71, elapsed: 2.240s, lr: 0.00074900 loss: 0.88772788\n",
      "Epoch [16] iter: 60/71, elapsed: 2.264s, lr: 0.00074516 loss: 0.79104602\n",
      "Epoch [16] iter: 70/71, elapsed: 2.219s, lr: 0.00074129 loss: 0.99877206\n",
      "validating\n",
      "Saved weight as logs/circor2_ar_byola.AR_BYOLA_8a96cef9/weights_ep16it70-0.68911_loss0.9988.pth\n",
      "circor2_ar_byola.AR_BYOLA_8a96cef9-lr001fm20tm50s43 | epoch/iter 16/70: val acc: 0.68911, loss: 0.99877, best: 0.68911@16\n",
      "Epoch [17] iter: 0/71, elapsed: 7.887s, lr: 0.00074090 loss: 1.00399310\n",
      "Epoch [17] iter: 10/71, elapsed: 2.343s, lr: 0.00073702 loss: 0.93190402\n",
      "Epoch [17] iter: 20/71, elapsed: 2.234s, lr: 0.00073311 loss: 1.00399048\n",
      "Epoch [17] iter: 30/71, elapsed: 2.291s, lr: 0.00072919 loss: 0.92075186\n",
      "Epoch [17] iter: 40/71, elapsed: 2.958s, lr: 0.00072525 loss: 1.12829175\n",
      "Epoch [17] iter: 50/71, elapsed: 2.285s, lr: 0.00072129 loss: 0.87303259\n",
      "Epoch [17] iter: 60/71, elapsed: 2.290s, lr: 0.00071731 loss: 0.97755658\n",
      "Epoch [17] iter: 70/71, elapsed: 2.286s, lr: 0.00071332 loss: 0.64865351\n",
      "validating\n",
      "circor2_ar_byola.AR_BYOLA_8a96cef9-lr001fm20tm50s43 | epoch/iter 17/70: val acc: 0.48988, loss: 0.64865, best: 0.68911@16\n",
      "Epoch [18] iter: 0/71, elapsed: 7.702s, lr: 0.00071292 loss: 0.93589237\n",
      "Epoch [18] iter: 10/71, elapsed: 2.251s, lr: 0.00070891 loss: 0.88478310\n",
      "Epoch [18] iter: 20/71, elapsed: 2.278s, lr: 0.00070488 loss: 0.90027854\n",
      "Epoch [18] iter: 30/71, elapsed: 2.205s, lr: 0.00070083 loss: 0.92200129\n",
      "Epoch [18] iter: 40/71, elapsed: 2.891s, lr: 0.00069678 loss: 1.11745527\n",
      "Epoch [18] iter: 50/71, elapsed: 2.216s, lr: 0.00069270 loss: 0.85554581\n",
      "Epoch [18] iter: 60/71, elapsed: 2.271s, lr: 0.00068861 loss: 0.92708952\n",
      "Epoch [18] iter: 70/71, elapsed: 2.210s, lr: 0.00068451 loss: 0.85962564\n",
      "validating\n",
      "circor2_ar_byola.AR_BYOLA_8a96cef9-lr001fm20tm50s43 | epoch/iter 18/70: val acc: 0.50700, loss: 0.85963, best: 0.68911@16\n",
      "Epoch [19] iter: 0/71, elapsed: 7.850s, lr: 0.00068409 loss: 0.98284835\n",
      "Epoch [19] iter: 10/71, elapsed: 2.229s, lr: 0.00067997 loss: 0.93834098\n",
      "Epoch [19] iter: 20/71, elapsed: 2.169s, lr: 0.00067584 loss: 0.84076920\n",
      "Epoch [19] iter: 30/71, elapsed: 2.360s, lr: 0.00067169 loss: 0.75276370\n",
      "Epoch [19] iter: 40/71, elapsed: 2.895s, lr: 0.00066753 loss: 0.96565301\n",
      "Epoch [19] iter: 50/71, elapsed: 2.254s, lr: 0.00066335 loss: 0.89895907\n",
      "Epoch [19] iter: 60/71, elapsed: 2.247s, lr: 0.00065916 loss: 0.98372126\n",
      "Epoch [19] iter: 70/71, elapsed: 2.222s, lr: 0.00065496 loss: 1.08797559\n",
      "validating\n",
      "circor2_ar_byola.AR_BYOLA_8a96cef9-lr001fm20tm50s43 | epoch/iter 19/70: val acc: 0.57782, loss: 1.08798, best: 0.68911@16\n",
      "Epoch [20] iter: 0/71, elapsed: 7.668s, lr: 0.00065454 loss: 1.06983102\n",
      "Epoch [20] iter: 10/71, elapsed: 2.379s, lr: 0.00065033 loss: 0.96339693\n",
      "Epoch [20] iter: 20/71, elapsed: 2.256s, lr: 0.00064610 loss: 0.84031101\n",
      "Epoch [20] iter: 30/71, elapsed: 2.258s, lr: 0.00064187 loss: 0.90895343\n",
      "Epoch [20] iter: 40/71, elapsed: 2.877s, lr: 0.00063762 loss: 0.85380126\n",
      "Epoch [20] iter: 50/71, elapsed: 2.242s, lr: 0.00063336 loss: 0.90324707\n",
      "Epoch [20] iter: 60/71, elapsed: 2.238s, lr: 0.00062909 loss: 0.99748527\n",
      "Epoch [20] iter: 70/71, elapsed: 2.195s, lr: 0.00062481 loss: 1.17891867\n",
      "validating\n",
      "circor2_ar_byola.AR_BYOLA_8a96cef9-lr001fm20tm50s43 | epoch/iter 20/70: val acc: 0.58677, loss: 1.17892, best: 0.68911@16\n",
      "Epoch [21] iter: 0/71, elapsed: 7.705s, lr: 0.00062438 loss: 0.96356971\n",
      "Epoch [21] iter: 10/71, elapsed: 2.280s, lr: 0.00062009 loss: 0.90491985\n",
      "Epoch [21] iter: 20/71, elapsed: 2.255s, lr: 0.00061579 loss: 0.83909974\n",
      "Epoch [21] iter: 30/71, elapsed: 2.191s, lr: 0.00061148 loss: 1.06361687\n",
      "Epoch [21] iter: 40/71, elapsed: 2.858s, lr: 0.00060717 loss: 1.06271936\n",
      "Epoch [21] iter: 50/71, elapsed: 2.279s, lr: 0.00060284 loss: 0.95194004\n",
      "Epoch [21] iter: 60/71, elapsed: 2.213s, lr: 0.00059851 loss: 0.87887472\n",
      "Epoch [21] iter: 70/71, elapsed: 2.250s, lr: 0.00059417 loss: 0.87187410\n",
      "validating\n",
      "circor2_ar_byola.AR_BYOLA_8a96cef9-lr001fm20tm50s43 | epoch/iter 21/70: val acc: 0.51089, loss: 0.87187, best: 0.68911@16\n",
      "Epoch [22] iter: 0/71, elapsed: 7.741s, lr: 0.00059373 loss: 0.97950747\n",
      "Epoch [22] iter: 10/71, elapsed: 2.256s, lr: 0.00058938 loss: 0.94376391\n",
      "Epoch [22] iter: 20/71, elapsed: 2.263s, lr: 0.00058503 loss: 0.86428478\n",
      "Epoch [22] iter: 30/71, elapsed: 2.229s, lr: 0.00058066 loss: 0.80380623\n",
      "Epoch [22] iter: 40/71, elapsed: 2.849s, lr: 0.00057629 loss: 0.87818098\n",
      "Epoch [22] iter: 50/71, elapsed: 2.246s, lr: 0.00057192 loss: 0.89391957\n",
      "Epoch [22] iter: 60/71, elapsed: 2.237s, lr: 0.00056754 loss: 0.88779114\n",
      "Epoch [22] iter: 70/71, elapsed: 2.253s, lr: 0.00056315 loss: 0.72483447\n",
      "validating\n",
      "circor2_ar_byola.AR_BYOLA_8a96cef9-lr001fm20tm50s43 | epoch/iter 22/70: val acc: 0.40661, loss: 0.72483, best: 0.68911@16\n",
      "Epoch [23] iter: 0/71, elapsed: 7.610s, lr: 0.00056271 loss: 1.04086753\n",
      "Epoch [23] iter: 10/71, elapsed: 2.310s, lr: 0.00055832 loss: 0.85200551\n",
      "Epoch [23] iter: 20/71, elapsed: 2.230s, lr: 0.00055392 loss: 0.91430443\n",
      "Epoch [23] iter: 30/71, elapsed: 2.245s, lr: 0.00054952 loss: 0.96425595\n",
      "Epoch [23] iter: 40/71, elapsed: 2.973s, lr: 0.00054512 loss: 0.94134006\n",
      "Epoch [23] iter: 50/71, elapsed: 2.252s, lr: 0.00054071 loss: 0.90507018\n",
      "Epoch [23] iter: 60/71, elapsed: 2.204s, lr: 0.00053630 loss: 0.98421300\n",
      "Epoch [23] iter: 70/71, elapsed: 2.305s, lr: 0.00053188 loss: 0.95741788\n",
      "validating\n",
      "circor2_ar_byola.AR_BYOLA_8a96cef9-lr001fm20tm50s43 | epoch/iter 23/70: val acc: 0.43424, loss: 0.95742, best: 0.68911@16\n",
      "Epoch [24] iter: 0/71, elapsed: 7.940s, lr: 0.00053144 loss: 0.95076950\n",
      "Epoch [24] iter: 10/71, elapsed: 2.201s, lr: 0.00052703 loss: 0.81721582\n",
      "Epoch [24] iter: 20/71, elapsed: 2.211s, lr: 0.00052261 loss: 0.93261131\n",
      "Epoch [24] iter: 30/71, elapsed: 2.266s, lr: 0.00051819 loss: 1.01130799\n",
      "Epoch [24] iter: 40/71, elapsed: 2.815s, lr: 0.00051376 loss: 0.91690917\n",
      "Epoch [24] iter: 50/71, elapsed: 2.266s, lr: 0.00050934 loss: 1.06681536\n",
      "Epoch [24] iter: 60/71, elapsed: 2.289s, lr: 0.00050492 loss: 0.81442666\n",
      "Epoch [24] iter: 70/71, elapsed: 2.146s, lr: 0.00050049 loss: 0.76697881\n",
      "validating\n",
      "circor2_ar_byola.AR_BYOLA_8a96cef9-lr001fm20tm50s43 | epoch/iter 24/70: val acc: 0.58872, loss: 0.76698, best: 0.68911@16\n",
      "Epoch [25] iter: 0/71, elapsed: 7.890s, lr: 0.00050005 loss: 0.86327519\n",
      "Epoch [25] iter: 10/71, elapsed: 2.136s, lr: 0.00049563 loss: 0.83919248\n",
      "Epoch [25] iter: 20/71, elapsed: 2.243s, lr: 0.00049120 loss: 0.94660569\n",
      "Epoch [25] iter: 30/71, elapsed: 2.301s, lr: 0.00048678 loss: 0.91495968\n",
      "Epoch [25] iter: 40/71, elapsed: 2.927s, lr: 0.00048236 loss: 0.89607604\n",
      "Epoch [25] iter: 50/71, elapsed: 2.317s, lr: 0.00047794 loss: 0.89663641\n",
      "Epoch [25] iter: 60/71, elapsed: 2.284s, lr: 0.00047352 loss: 0.96392552\n",
      "Epoch [25] iter: 70/71, elapsed: 2.207s, lr: 0.00046910 loss: 1.01558838\n",
      "validating\n",
      "circor2_ar_byola.AR_BYOLA_8a96cef9-lr001fm20tm50s43 | epoch/iter 25/70: val acc: 0.53541, loss: 1.01559, best: 0.68911@16\n",
      "Epoch [26] iter: 0/71, elapsed: 7.852s, lr: 0.00046866 loss: 0.87805197\n",
      "Epoch [26] iter: 10/71, elapsed: 2.102s, lr: 0.00046424 loss: 1.08288418\n",
      "Epoch [26] iter: 20/71, elapsed: 2.249s, lr: 0.00045983 loss: 0.96867329\n",
      "Epoch [26] iter: 30/71, elapsed: 2.212s, lr: 0.00045542 loss: 0.85583161\n",
      "Epoch [26] iter: 40/71, elapsed: 3.029s, lr: 0.00045102 loss: 0.95289305\n",
      "Epoch [26] iter: 50/71, elapsed: 2.211s, lr: 0.00044662 loss: 1.00034104\n",
      "Epoch [26] iter: 60/71, elapsed: 2.146s, lr: 0.00044222 loss: 0.88651080\n",
      "Epoch [26] iter: 70/71, elapsed: 2.226s, lr: 0.00043783 loss: 0.78906377\n",
      "validating\n",
      "circor2_ar_byola.AR_BYOLA_8a96cef9-lr001fm20tm50s43 | epoch/iter 26/70: val acc: 0.53113, loss: 0.78906, best: 0.68911@16\n",
      "Epoch [27] iter: 0/71, elapsed: 7.713s, lr: 0.00043739 loss: 0.91749208\n",
      "Epoch [27] iter: 10/71, elapsed: 2.271s, lr: 0.00043300 loss: 0.78323066\n",
      "Epoch [27] iter: 20/71, elapsed: 2.243s, lr: 0.00042862 loss: 0.96255874\n",
      "Epoch [27] iter: 30/71, elapsed: 2.287s, lr: 0.00042424 loss: 0.92567236\n",
      "Epoch [27] iter: 40/71, elapsed: 2.941s, lr: 0.00041987 loss: 1.09458509\n",
      "Epoch [27] iter: 50/71, elapsed: 2.294s, lr: 0.00041551 loss: 1.03644387\n",
      "Epoch [27] iter: 60/71, elapsed: 2.257s, lr: 0.00041115 loss: 0.84607034\n",
      "Epoch [27] iter: 70/71, elapsed: 2.263s, lr: 0.00040680 loss: 0.87086215\n",
      "validating\n",
      "circor2_ar_byola.AR_BYOLA_8a96cef9-lr001fm20tm50s43 | epoch/iter 27/70: val acc: 0.14475, loss: 0.87086, best: 0.68911@16\n",
      "Epoch [28] iter: 0/71, elapsed: 7.645s, lr: 0.00040637 loss: 0.94052532\n",
      "Epoch [28] iter: 10/71, elapsed: 2.274s, lr: 0.00040203 loss: 0.92653685\n",
      "Epoch [28] iter: 20/71, elapsed: 2.253s, lr: 0.00039769 loss: 0.89686080\n",
      "Epoch [28] iter: 30/71, elapsed: 2.260s, lr: 0.00039337 loss: 0.94386171\n",
      "Epoch [28] iter: 40/71, elapsed: 2.913s, lr: 0.00038905 loss: 0.79599755\n",
      "Epoch [28] iter: 50/71, elapsed: 2.233s, lr: 0.00038474 loss: 0.92100688\n",
      "Epoch [28] iter: 60/71, elapsed: 2.277s, lr: 0.00038044 loss: 0.78800079\n",
      "Epoch [28] iter: 70/71, elapsed: 2.226s, lr: 0.00037615 loss: 0.85273110\n",
      "validating\n",
      "circor2_ar_byola.AR_BYOLA_8a96cef9-lr001fm20tm50s43 | epoch/iter 28/70: val acc: 0.48521, loss: 0.85273, best: 0.68911@16\n",
      "Epoch [29] iter: 0/71, elapsed: 7.851s, lr: 0.00037572 loss: 0.97105540\n",
      "Epoch [29] iter: 10/71, elapsed: 2.161s, lr: 0.00037144 loss: 0.88211703\n",
      "Epoch [29] iter: 20/71, elapsed: 2.265s, lr: 0.00036717 loss: 0.83300452\n",
      "Epoch [29] iter: 30/71, elapsed: 2.272s, lr: 0.00036291 loss: 0.98501954\n",
      "Epoch [29] iter: 40/71, elapsed: 2.895s, lr: 0.00035866 loss: 0.97268335\n",
      "Epoch [29] iter: 50/71, elapsed: 2.272s, lr: 0.00035442 loss: 0.86656292\n",
      "Epoch [29] iter: 60/71, elapsed: 2.235s, lr: 0.00035019 loss: 1.04680784\n",
      "Epoch [29] iter: 70/71, elapsed: 2.237s, lr: 0.00034598 loss: 0.93906023\n",
      "validating\n",
      "circor2_ar_byola.AR_BYOLA_8a96cef9-lr001fm20tm50s43 | epoch/iter 29/70: val acc: 0.57082, loss: 0.93906, best: 0.68911@16\n",
      "Epoch [30] iter: 0/71, elapsed: 7.863s, lr: 0.00034556 loss: 0.77564294\n",
      "Epoch [30] iter: 10/71, elapsed: 2.198s, lr: 0.00034136 loss: 0.84927375\n",
      "Epoch [30] iter: 20/71, elapsed: 2.224s, lr: 0.00033717 loss: 0.86415474\n",
      "Epoch [30] iter: 30/71, elapsed: 2.308s, lr: 0.00033299 loss: 0.83376627\n",
      "Epoch [30] iter: 40/71, elapsed: 3.055s, lr: 0.00032883 loss: 0.88611105\n",
      "Epoch [30] iter: 50/71, elapsed: 2.233s, lr: 0.00032468 loss: 0.88323471\n",
      "Epoch [30] iter: 60/71, elapsed: 2.308s, lr: 0.00032054 loss: 0.87123218\n",
      "Epoch [30] iter: 70/71, elapsed: 2.253s, lr: 0.00031642 loss: 0.83334588\n",
      "validating\n",
      "circor2_ar_byola.AR_BYOLA_8a96cef9-lr001fm20tm50s43 | epoch/iter 30/70: val acc: 0.53774, loss: 0.83335, best: 0.68911@16\n",
      "Epoch [31] iter: 0/71, elapsed: 7.720s, lr: 0.00031601 loss: 0.85770989\n",
      "Epoch [31] iter: 10/71, elapsed: 2.163s, lr: 0.00031190 loss: 1.01642971\n",
      "Epoch [31] iter: 20/71, elapsed: 2.303s, lr: 0.00030781 loss: 1.00017809\n",
      "Epoch [31] iter: 30/71, elapsed: 2.204s, lr: 0.00030373 loss: 0.80667599\n",
      "Epoch [31] iter: 40/71, elapsed: 2.902s, lr: 0.00029967 loss: 0.84556675\n",
      "Epoch [31] iter: 50/71, elapsed: 2.251s, lr: 0.00029562 loss: 0.98156801\n",
      "Epoch [31] iter: 60/71, elapsed: 2.234s, lr: 0.00029160 loss: 0.94818685\n",
      "Epoch [31] iter: 70/71, elapsed: 2.213s, lr: 0.00028758 loss: 0.86049817\n",
      "validating\n",
      "circor2_ar_byola.AR_BYOLA_8a96cef9-lr001fm20tm50s43 | epoch/iter 31/70: val acc: 0.57276, loss: 0.86050, best: 0.68911@16\n",
      "Epoch [32] iter: 0/71, elapsed: 7.978s, lr: 0.00028718 loss: 0.85896957\n",
      "Epoch [32] iter: 10/71, elapsed: 2.061s, lr: 0.00028319 loss: 0.88072990\n",
      "Epoch [32] iter: 20/71, elapsed: 2.226s, lr: 0.00027921 loss: 0.96001398\n",
      "Epoch [32] iter: 30/71, elapsed: 2.231s, lr: 0.00027525 loss: 0.85066659\n",
      "Epoch [32] iter: 40/71, elapsed: 2.853s, lr: 0.00027131 loss: 0.99031610\n",
      "Epoch [32] iter: 50/71, elapsed: 2.394s, lr: 0.00026738 loss: 0.84923623\n",
      "Epoch [32] iter: 60/71, elapsed: 2.275s, lr: 0.00026347 loss: 0.82919491\n",
      "Epoch [32] iter: 70/71, elapsed: 2.302s, lr: 0.00025959 loss: 1.12353900\n",
      "validating\n",
      "circor2_ar_byola.AR_BYOLA_8a96cef9-lr001fm20tm50s43 | epoch/iter 32/70: val acc: 0.53074, loss: 1.12354, best: 0.68911@16\n",
      "Epoch [33] iter: 0/71, elapsed: 7.617s, lr: 0.00025920 loss: 0.90964264\n",
      "Epoch [33] iter: 10/71, elapsed: 2.258s, lr: 0.00025533 loss: 0.83836257\n",
      "Epoch [33] iter: 20/71, elapsed: 2.305s, lr: 0.00025148 loss: 0.98029320\n",
      "Epoch [33] iter: 30/71, elapsed: 2.261s, lr: 0.00024765 loss: 0.96141543\n",
      "Epoch [33] iter: 40/71, elapsed: 2.879s, lr: 0.00024384 loss: 0.91700651\n",
      "Epoch [33] iter: 50/71, elapsed: 2.265s, lr: 0.00024005 loss: 0.86896542\n",
      "Epoch [33] iter: 60/71, elapsed: 2.230s, lr: 0.00023629 loss: 0.86589136\n",
      "Epoch [33] iter: 70/71, elapsed: 2.236s, lr: 0.00023254 loss: 1.10079518\n",
      "validating\n",
      "circor2_ar_byola.AR_BYOLA_8a96cef9-lr001fm20tm50s43 | epoch/iter 33/70: val acc: 0.56887, loss: 1.10080, best: 0.68911@16\n",
      "Epoch [34] iter: 0/71, elapsed: 7.630s, lr: 0.00023216 loss: 0.84751241\n",
      "Epoch [34] iter: 10/71, elapsed: 2.328s, lr: 0.00022844 loss: 0.78657679\n",
      "Epoch [34] iter: 20/71, elapsed: 2.233s, lr: 0.00022473 loss: 0.93425902\n",
      "Epoch [34] iter: 30/71, elapsed: 2.238s, lr: 0.00022105 loss: 0.88727828\n",
      "Epoch [34] iter: 40/71, elapsed: 2.934s, lr: 0.00021739 loss: 0.83111601\n",
      "Epoch [34] iter: 50/71, elapsed: 2.259s, lr: 0.00021375 loss: 0.83642090\n",
      "Epoch [34] iter: 60/71, elapsed: 2.243s, lr: 0.00021014 loss: 0.92233134\n",
      "Epoch [34] iter: 70/71, elapsed: 2.220s, lr: 0.00020654 loss: 0.82246562\n",
      "validating\n",
      "circor2_ar_byola.AR_BYOLA_8a96cef9-lr001fm20tm50s43 | epoch/iter 34/70: val acc: 0.46770, loss: 0.82247, best: 0.68911@16\n",
      "Epoch [35] iter: 0/71, elapsed: 7.577s, lr: 0.00020619 loss: 0.83529172\n",
      "Epoch [35] iter: 10/71, elapsed: 2.225s, lr: 0.00020262 loss: 0.92452774\n",
      "Epoch [35] iter: 20/71, elapsed: 2.265s, lr: 0.00019907 loss: 0.94794610\n",
      "Epoch [35] iter: 30/71, elapsed: 2.272s, lr: 0.00019555 loss: 0.93897069\n",
      "Epoch [35] iter: 40/71, elapsed: 2.970s, lr: 0.00019206 loss: 0.87000122\n",
      "Epoch [35] iter: 50/71, elapsed: 2.237s, lr: 0.00018858 loss: 1.02381800\n",
      "Epoch [35] iter: 60/71, elapsed: 2.217s, lr: 0.00018513 loss: 0.97659404\n",
      "Epoch [35] iter: 70/71, elapsed: 2.230s, lr: 0.00018171 loss: 0.80436343\n",
      "validating\n",
      "circor2_ar_byola.AR_BYOLA_8a96cef9-lr001fm20tm50s43 | epoch/iter 35/70: val acc: 0.58444, loss: 0.80436, best: 0.68911@16\n",
      "Epoch [36] iter: 0/71, elapsed: 7.739s, lr: 0.00018137 loss: 0.82681658\n",
      "Epoch [36] iter: 10/71, elapsed: 2.251s, lr: 0.00017797 loss: 1.09019519\n",
      "Epoch [36] iter: 20/71, elapsed: 2.235s, lr: 0.00017460 loss: 0.88718456\n",
      "Epoch [36] iter: 30/71, elapsed: 2.220s, lr: 0.00017126 loss: 1.05116928\n",
      "Epoch [36] iter: 40/71, elapsed: 2.921s, lr: 0.00016794 loss: 0.90387203\n",
      "Epoch [36] iter: 50/71, elapsed: 2.243s, lr: 0.00016464 loss: 1.03289029\n",
      "Epoch [36] iter: 60/71, elapsed: 2.243s, lr: 0.00016137 loss: 0.87043126\n",
      "Epoch [36] iter: 70/71, elapsed: 2.233s, lr: 0.00015813 loss: 0.69886577\n",
      "validating\n",
      "circor2_ar_byola.AR_BYOLA_8a96cef9-lr001fm20tm50s43 | epoch/iter 36/70: val acc: 0.55720, loss: 0.69887, best: 0.68911@16\n",
      "Epoch [37] iter: 0/71, elapsed: 7.747s, lr: 0.00015781 loss: 0.96221794\n",
      "Epoch [37] iter: 10/71, elapsed: 2.285s, lr: 0.00015460 loss: 0.90985508\n",
      "Epoch [37] iter: 20/71, elapsed: 2.282s, lr: 0.00015141 loss: 0.80161067\n",
      "Epoch [37] iter: 30/71, elapsed: 2.243s, lr: 0.00014826 loss: 0.87481023\n",
      "Epoch [37] iter: 40/71, elapsed: 2.936s, lr: 0.00014513 loss: 0.85734353\n",
      "Epoch [37] iter: 50/71, elapsed: 2.271s, lr: 0.00014202 loss: 0.85681658\n",
      "Epoch [37] iter: 60/71, elapsed: 2.253s, lr: 0.00013895 loss: 0.82275754\n",
      "Epoch [37] iter: 70/71, elapsed: 2.252s, lr: 0.00013591 loss: 1.01566399\n",
      "validating\n",
      "circor2_ar_byola.AR_BYOLA_8a96cef9-lr001fm20tm50s43 | epoch/iter 37/70: val acc: 0.54202, loss: 1.01566, best: 0.68911@16\n",
      "Epoch [38] iter: 0/71, elapsed: 7.704s, lr: 0.00013560 loss: 0.90491677\n",
      "Epoch [38] iter: 10/71, elapsed: 2.298s, lr: 0.00013259 loss: 0.94400471\n",
      "Epoch [38] iter: 20/71, elapsed: 2.266s, lr: 0.00012960 loss: 0.82685068\n",
      "Epoch [38] iter: 30/71, elapsed: 2.286s, lr: 0.00012665 loss: 0.84788621\n",
      "Epoch [38] iter: 40/71, elapsed: 2.892s, lr: 0.00012372 loss: 0.89173709\n",
      "Epoch [38] iter: 50/71, elapsed: 2.245s, lr: 0.00012082 loss: 0.91979813\n",
      "Epoch [38] iter: 60/71, elapsed: 2.230s, lr: 0.00011795 loss: 0.96947008\n",
      "Epoch [38] iter: 70/71, elapsed: 2.230s, lr: 0.00011511 loss: 0.95972597\n",
      "validating\n",
      "circor2_ar_byola.AR_BYOLA_8a96cef9-lr001fm20tm50s43 | epoch/iter 38/70: val acc: 0.58521, loss: 0.95973, best: 0.68911@16\n",
      "Epoch [39] iter: 0/71, elapsed: 7.631s, lr: 0.00011483 loss: 0.86795060\n",
      "Epoch [39] iter: 10/71, elapsed: 2.288s, lr: 0.00011203 loss: 0.93960729\n",
      "Epoch [39] iter: 20/71, elapsed: 2.247s, lr: 0.00010925 loss: 0.84489609\n",
      "Epoch [39] iter: 30/71, elapsed: 2.272s, lr: 0.00010651 loss: 1.16238609\n",
      "Epoch [39] iter: 40/71, elapsed: 2.938s, lr: 0.00010379 loss: 0.91955748\n",
      "Epoch [39] iter: 50/71, elapsed: 2.247s, lr: 0.00010111 loss: 1.01489548\n",
      "Epoch [39] iter: 60/71, elapsed: 2.255s, lr: 0.00009846 loss: 0.81956001\n",
      "Epoch [39] iter: 70/71, elapsed: 2.198s, lr: 0.00009584 loss: 1.18239722\n",
      "validating\n",
      "circor2_ar_byola.AR_BYOLA_8a96cef9-lr001fm20tm50s43 | epoch/iter 39/70: val acc: 0.51712, loss: 1.18240, best: 0.68911@16\n",
      "Epoch [40] iter: 0/71, elapsed: 7.532s, lr: 0.00009558 loss: 0.87228401\n",
      "Epoch [40] iter: 10/71, elapsed: 2.440s, lr: 0.00009300 loss: 0.94249916\n",
      "Epoch [40] iter: 20/71, elapsed: 2.204s, lr: 0.00009044 loss: 0.97401022\n",
      "Epoch [40] iter: 30/71, elapsed: 2.252s, lr: 0.00008792 loss: 0.93838623\n",
      "Epoch [40] iter: 40/71, elapsed: 2.807s, lr: 0.00008544 loss: 0.77617479\n",
      "Epoch [40] iter: 50/71, elapsed: 2.287s, lr: 0.00008298 loss: 0.89062505\n",
      "Epoch [40] iter: 60/71, elapsed: 2.256s, lr: 0.00008056 loss: 0.89578368\n",
      "Epoch [40] iter: 70/71, elapsed: 2.227s, lr: 0.00007817 loss: 0.99209141\n",
      "validating\n",
      "circor2_ar_byola.AR_BYOLA_8a96cef9-lr001fm20tm50s43 | epoch/iter 40/70: val acc: 0.51362, loss: 0.99209, best: 0.68911@16\n",
      "Epoch [41] iter: 0/71, elapsed: 7.582s, lr: 0.00007793 loss: 0.92620195\n",
      "Epoch [41] iter: 10/71, elapsed: 2.333s, lr: 0.00007557 loss: 0.95559860\n",
      "Epoch [41] iter: 20/71, elapsed: 2.191s, lr: 0.00007325 loss: 0.84790307\n",
      "Epoch [41] iter: 30/71, elapsed: 2.246s, lr: 0.00007097 loss: 0.76708127\n",
      "Epoch [41] iter: 40/71, elapsed: 2.801s, lr: 0.00006871 loss: 0.89022397\n",
      "Epoch [41] iter: 50/71, elapsed: 2.213s, lr: 0.00006649 loss: 1.01101800\n",
      "Epoch [41] iter: 60/71, elapsed: 2.226s, lr: 0.00006431 loss: 0.98591371\n",
      "Epoch [41] iter: 70/71, elapsed: 2.176s, lr: 0.00006215 loss: 0.95072033\n",
      "validating\n",
      "circor2_ar_byola.AR_BYOLA_8a96cef9-lr001fm20tm50s43 | epoch/iter 41/70: val acc: 0.56031, loss: 0.95072, best: 0.68911@16\n",
      "Epoch [42] iter: 0/71, elapsed: 7.662s, lr: 0.00006194 loss: 0.86121157\n",
      "Epoch [42] iter: 10/71, elapsed: 2.250s, lr: 0.00005983 loss: 0.82436747\n",
      "Epoch [42] iter: 20/71, elapsed: 2.331s, lr: 0.00005775 loss: 0.83786577\n",
      "Epoch [42] iter: 30/71, elapsed: 2.236s, lr: 0.00005570 loss: 0.85773019\n",
      "Epoch [42] iter: 40/71, elapsed: 2.972s, lr: 0.00005369 loss: 0.93935462\n",
      "Epoch [42] iter: 50/71, elapsed: 2.234s, lr: 0.00005172 loss: 0.90307624\n",
      "Epoch [42] iter: 60/71, elapsed: 2.230s, lr: 0.00004978 loss: 0.87972010\n",
      "Epoch [42] iter: 70/71, elapsed: 2.218s, lr: 0.00004787 loss: 0.88348462\n",
      "validating\n",
      "circor2_ar_byola.AR_BYOLA_8a96cef9-lr001fm20tm50s43 | epoch/iter 42/70: val acc: 0.63230, loss: 0.88348, best: 0.68911@16\n",
      "Epoch [43] iter: 0/71, elapsed: 7.688s, lr: 0.00004768 loss: 0.82859727\n",
      "Epoch [43] iter: 10/71, elapsed: 2.232s, lr: 0.00004582 loss: 0.89735042\n",
      "Epoch [43] iter: 20/71, elapsed: 2.257s, lr: 0.00004399 loss: 1.08835625\n",
      "Epoch [43] iter: 30/71, elapsed: 2.288s, lr: 0.00004219 loss: 0.89130680\n",
      "Epoch [43] iter: 40/71, elapsed: 2.881s, lr: 0.00004043 loss: 0.93876705\n",
      "Epoch [43] iter: 50/71, elapsed: 2.303s, lr: 0.00003871 loss: 0.83377706\n",
      "Epoch [43] iter: 60/71, elapsed: 2.199s, lr: 0.00003702 loss: 0.86911597\n",
      "Epoch [43] iter: 70/71, elapsed: 2.213s, lr: 0.00003537 loss: 0.83005358\n",
      "validating\n",
      "circor2_ar_byola.AR_BYOLA_8a96cef9-lr001fm20tm50s43 | epoch/iter 43/70: val acc: 0.49339, loss: 0.83005, best: 0.68911@16\n",
      "Epoch [44] iter: 0/71, elapsed: 7.747s, lr: 0.00003521 loss: 0.94270461\n",
      "Epoch [44] iter: 10/71, elapsed: 2.243s, lr: 0.00003360 loss: 0.95479292\n",
      "Epoch [44] iter: 20/71, elapsed: 2.294s, lr: 0.00003202 loss: 0.80922800\n",
      "Epoch [44] iter: 30/71, elapsed: 2.256s, lr: 0.00003049 loss: 0.97233069\n",
      "Epoch [44] iter: 40/71, elapsed: 2.908s, lr: 0.00002899 loss: 0.88500244\n",
      "Epoch [44] iter: 50/71, elapsed: 2.264s, lr: 0.00002752 loss: 0.96636043\n",
      "Epoch [44] iter: 60/71, elapsed: 2.290s, lr: 0.00002610 loss: 0.81527332\n",
      "Epoch [44] iter: 70/71, elapsed: 2.218s, lr: 0.00002471 loss: 0.71353142\n",
      "validating\n",
      "circor2_ar_byola.AR_BYOLA_8a96cef9-lr001fm20tm50s43 | epoch/iter 44/70: val acc: 0.60350, loss: 0.71353, best: 0.68911@16\n",
      "Epoch [45] iter: 0/71, elapsed: 7.707s, lr: 0.00002457 loss: 1.00407802\n",
      "Epoch [45] iter: 10/71, elapsed: 2.235s, lr: 0.00002322 loss: 0.82128909\n",
      "Epoch [45] iter: 20/71, elapsed: 2.263s, lr: 0.00002191 loss: 0.78799967\n",
      "Epoch [45] iter: 30/71, elapsed: 2.251s, lr: 0.00002064 loss: 0.89102875\n",
      "Epoch [45] iter: 40/71, elapsed: 2.886s, lr: 0.00001940 loss: 0.98051230\n",
      "Epoch [45] iter: 50/71, elapsed: 2.185s, lr: 0.00001820 loss: 0.87502615\n",
      "Epoch [45] iter: 60/71, elapsed: 2.240s, lr: 0.00001704 loss: 0.95963816\n",
      "Epoch [45] iter: 70/71, elapsed: 2.181s, lr: 0.00001592 loss: 1.12421540\n",
      "validating\n",
      "circor2_ar_byola.AR_BYOLA_8a96cef9-lr001fm20tm50s43 | epoch/iter 45/70: val acc: 0.55019, loss: 1.12422, best: 0.68911@16\n",
      "Epoch [46] iter: 0/71, elapsed: 7.686s, lr: 0.00001581 loss: 1.05770141\n",
      "Epoch [46] iter: 10/71, elapsed: 2.245s, lr: 0.00001473 loss: 0.91550390\n",
      "Epoch [46] iter: 20/71, elapsed: 2.362s, lr: 0.00001368 loss: 0.79131156\n",
      "Epoch [46] iter: 30/71, elapsed: 2.277s, lr: 0.00001268 loss: 0.91643503\n",
      "Epoch [46] iter: 40/71, elapsed: 2.872s, lr: 0.00001171 loss: 0.80365764\n",
      "Epoch [46] iter: 50/71, elapsed: 2.235s, lr: 0.00001078 loss: 0.80399302\n",
      "Epoch [46] iter: 60/71, elapsed: 2.255s, lr: 0.00000989 loss: 0.94634989\n",
      "Epoch [46] iter: 70/71, elapsed: 2.219s, lr: 0.00000904 loss: 0.67716549\n",
      "validating\n",
      "circor2_ar_byola.AR_BYOLA_8a96cef9-lr001fm20tm50s43 | epoch/iter 46/70: val acc: 0.62296, loss: 0.67717, best: 0.68911@16\n",
      "Epoch [47] iter: 0/71, elapsed: 7.694s, lr: 0.00000896 loss: 0.86767241\n",
      "Epoch [47] iter: 10/71, elapsed: 2.176s, lr: 0.00000815 loss: 0.79477387\n",
      "Epoch [47] iter: 20/71, elapsed: 2.308s, lr: 0.00000737 loss: 0.87118834\n",
      "Epoch [47] iter: 30/71, elapsed: 2.254s, lr: 0.00000664 loss: 0.88353536\n",
      "Epoch [47] iter: 40/71, elapsed: 2.882s, lr: 0.00000595 loss: 0.89271841\n",
      "Epoch [47] iter: 50/71, elapsed: 2.218s, lr: 0.00000529 loss: 0.90009177\n",
      "Epoch [47] iter: 60/71, elapsed: 2.235s, lr: 0.00000468 loss: 0.91063955\n",
      "Epoch [47] iter: 70/71, elapsed: 2.154s, lr: 0.00000410 loss: 1.11908857\n",
      "validating\n",
      "circor2_ar_byola.AR_BYOLA_8a96cef9-lr001fm20tm50s43 | epoch/iter 47/70: val acc: 0.57198, loss: 1.11909, best: 0.68911@16\n",
      "Epoch [48] iter: 0/71, elapsed: 7.997s, lr: 0.00000404 loss: 0.92894531\n",
      "Epoch [48] iter: 10/71, elapsed: 2.181s, lr: 0.00000351 loss: 1.06633647\n",
      "Epoch [48] iter: 20/71, elapsed: 2.171s, lr: 0.00000301 loss: 0.89909028\n",
      "Epoch [48] iter: 30/71, elapsed: 2.210s, lr: 0.00000255 loss: 1.05943430\n",
      "Epoch [48] iter: 40/71, elapsed: 2.776s, lr: 0.00000214 loss: 0.95515400\n",
      "Epoch [48] iter: 50/71, elapsed: 2.202s, lr: 0.00000176 loss: 0.83435788\n",
      "Epoch [48] iter: 60/71, elapsed: 2.193s, lr: 0.00000142 loss: 0.79737263\n",
      "Epoch [48] iter: 70/71, elapsed: 2.217s, lr: 0.00000111 loss: 1.00440074\n",
      "validating\n",
      "circor2_ar_byola.AR_BYOLA_8a96cef9-lr001fm20tm50s43 | epoch/iter 48/70: val acc: 0.46770, loss: 1.00440, best: 0.68911@16\n",
      "Epoch [49] iter: 0/71, elapsed: 7.751s, lr: 0.00000109 loss: 0.92719853\n",
      "Epoch [49] iter: 10/71, elapsed: 2.217s, lr: 0.00000083 loss: 0.80439273\n",
      "Epoch [49] iter: 20/71, elapsed: 2.251s, lr: 0.00000061 loss: 0.93618483\n",
      "Epoch [49] iter: 30/71, elapsed: 2.245s, lr: 0.00000043 loss: 0.89606005\n",
      "Epoch [49] iter: 40/71, elapsed: 2.860s, lr: 0.00000029 loss: 0.86795506\n",
      "Epoch [49] iter: 50/71, elapsed: 2.256s, lr: 0.00000019 loss: 0.94705839\n",
      "Epoch [49] iter: 60/71, elapsed: 2.231s, lr: 0.00000012 loss: 0.92629681\n",
      "Epoch [49] iter: 70/71, elapsed: 2.214s, lr: 0.00000010 loss: 0.80101886\n",
      "validating\n",
      "circor2_ar_byola.AR_BYOLA_8a96cef9-lr001fm20tm50s43 | epoch/iter 49/70: val acc: 0.53502, loss: 0.80102, best: 0.68911@16\n",
      "Load best weight from logs/circor2_ar_byola.AR_BYOLA_8a96cef9/weights_ep16it70-0.68911_loss0.9988.pth\n",
      "testing\n",
      "Final test acc: 0.66745\n",
      "Finetuning circor2_ar_byola.AR_BYOLA_8a96cef9-lr001fm20tm50s43 on circor2 -> mean score: 0.66745, best weight: logs/circor2_ar_byola.AR_BYOLA_8a96cef9/weights_ep16it70-0.68911_loss0.9988.pth, score file: logs/circor2_ar_byola.AR_BYOLA_8a96cef9/circor2_ar-byola.BYOLA-FT_8a96cef9_0.66745.csv, config: {'audio_repr': 'ar_byola.AR_BYOLA', 'weight_file': 'external/byol_a/pretrained_weights/AudioNTT2020-BYOLA-64x96d2048.pth', 'feature_d': 2048, 'sample_rate': 16000, 'n_fft': 1024, 'window_size': 1024, 'hop_size': 160, 'n_mels': 64, 'f_min': 60, 'f_max': 7800, 'temporal_pooling_type': 'mean_max', 'batch_size': 256, 'lr_lineareval': 0.0003, 'report_per_epochs': 20, 'early_stop_epochs': 20, 'warmup_epochs': 5, 'mixup': 0.0, 'ft_bs': 256, 'ft_lr': 0.001, 'ft_early_stop_epochs': -1, 'ft_epochs': 50, 'ft_freq_mask': 20, 'ft_time_mask': 50, 'ft_rrc': False, 'name': '', 'task_metadata': 'evar/metadata/circor2.csv', 'task_data': 'work/16k/circor2', 'unit_samples': 80000, 'id': 'circor2_ar_byola.AR_BYOLA_8a96cef9', 'training_mask': 0.0, 'optim': 'sgd', 'unit_sec': None, 'data_path': 'work', 'runtime_cfg': {'lr': 0.001, 'seed': 43, 'hidden': [], 'mixup': 0.0, 'bs': 256, 'freq_mask': 20, 'time_mask': 50, 'rrc': False, 'epochs': 50, 'early_stop_epochs': -1, 'n_class': 3, 'id': 'c8e723cc'}}\n",
      "weight_file=external/byol_a/pretrained_weights/AudioNTT2020-BYOLA-64x96d2048.pth\n",
      "+task_metadata=evar/metadata/circor2.csv,+task_data=work/16k/circor2,+unit_samples=80000\n",
      "Classes: ['Absent' 'Present' 'Unknown']\n",
      " using network pretrained weight: AudioNTT2020-BYOLA-64x96d2048.pth\n",
      "['features.0.weight', 'features.0.bias', 'features.1.weight', 'features.1.bias', 'features.1.running_mean', 'features.1.running_var', 'features.1.num_batches_tracked', 'features.4.weight', 'features.4.bias', 'features.5.weight', 'features.5.bias', 'features.5.running_mean', 'features.5.running_var', 'features.5.num_batches_tracked', 'features.8.weight', 'features.8.bias', 'features.9.weight', 'features.9.bias', 'features.9.running_mean', 'features.9.running_var', 'features.9.num_batches_tracked', 'fc.0.weight', 'fc.0.bias', 'fc.3.weight', 'fc.3.bias']\n",
      "<All keys matched successfully>\n",
      " using spectrogram norimalization stats: [-10.878346    5.1895504]\n",
      "2048 [] 3\n",
      "Backbone representation:\n",
      "Total number of parameters: 5,321,856 (trainable 5,321,856)\n",
      "Trainable parameters: ['body.features.0.weight', 'body.features.0.bias', 'body.features.1.weight', 'body.features.1.bias', 'body.features.4.weight', 'body.features.4.bias', 'body.features.5.weight', 'body.features.5.bias', 'body.features.8.weight', 'body.features.8.bias'] ...\n",
      "Others are frozen such as: [] \n",
      "Head:\n",
      "Total number of parameters: 6,147 (trainable 6,147)\n",
      "Trainable parameters: ['mlp.mlp.0.weight', 'mlp.mlp.0.bias']\n",
      "Others are frozen such as: [] \n",
      "Using checkpoint logs/circor2_ar_byola.AR_BYOLA_8a96cef9/weights_ep16it70-0.68911_loss0.9988.pth\n",
      "<All keys matched successfully>\n",
      "Test file folder: ../heart-murmur-detection/data/stratified_data2/test_data/\n",
      "Test files: ['13918', '14998'] ['../heart-murmur-detection/data/stratified_data2/test_data/13918.txt', '../heart-murmur-detection/data/stratified_data2/test_data/14998.txt']\n",
      "100%|█████████████████████████████████████████| 236/236 [00:08<00:00, 28.72it/s]\n",
      "Label decision follows: Panah et al. “Exploring Wav2vec 2.0 Model for Heart Murmur Detection.” EUSIPCO, 2023, pp. 1010–14.\n",
      "#Murmur scores\n",
      "AUROC,AUPRC,F-measure,Accuracy,Weighted Accuracy,UAR\n",
      "0.818,0.695,0.466,0.542,0.551,0.589\n",
      "\n",
      "#Murmur scores (per class)\n",
      "Classes,Present,Unknown,Absent\n",
      "AUROC,0.782,0.895,0.777\n",
      "AUPRC,0.662,0.546,0.877\n",
      "F-measure,0.475,0.267,0.655\n",
      "Accuracy,0.533,0.706,0.529\n",
      "\n",
      "Finetuning circor2_ar_byola.AR_BYOLA_8a96cef9- on circor2 -> weighted_accuracy: 0.55111. UAR: 0.58932, recall per class: [0.53333333 0.70588235 0.52873563], best weight: logs/circor2_ar_byola.AR_BYOLA_8a96cef9/weights_ep16it70-0.68911_loss0.9988.pth, config: {'audio_repr': 'ar_byola.AR_BYOLA', 'weight_file': 'external/byol_a/pretrained_weights/AudioNTT2020-BYOLA-64x96d2048.pth', 'feature_d': 2048, 'sample_rate': 16000, 'n_fft': 1024, 'window_size': 1024, 'hop_size': 160, 'n_mels': 64, 'f_min': 60, 'f_max': 7800, 'temporal_pooling_type': 'mean_max', 'batch_size': 256, 'lr_lineareval': 0.0003, 'report_per_epochs': 20, 'early_stop_epochs': 20, 'warmup_epochs': 5, 'mixup': 0.0, 'ft_bs': 256, 'ft_lr': 0.001, 'ft_early_stop_epochs': -1, 'ft_epochs': 50, 'ft_freq_mask': 20, 'ft_time_mask': 50, 'ft_rrc': False, 'name': '', 'task_metadata': 'evar/metadata/circor2.csv', 'task_data': 'work/16k/circor2', 'unit_samples': 80000, 'id': 'circor2_ar_byola.AR_BYOLA_8a96cef9', 'training_mask': 0.0, 'optim': 'sgd', 'unit_sec': None, 'data_path': 'work', 'eval_checkpoint': PosixPath('logs/circor2_ar_byola.AR_BYOLA_8a96cef9/weights_ep16it70-0.68911_loss0.9988.pth'), 'runtime_cfg': {'lr': 0.001, 'seed': 43, 'hidden': [], 'mixup': 0.0, 'bs': 256, 'freq_mask': 20, 'time_mask': 50, 'rrc': False, 'epochs': 50, 'early_stop_epochs': -1, 'n_class': 3, 'id': 'c8e723cc'}}\n",
      "Probabilities saved as: probs/logs-circor2_ar_byola.AR_BYOLA_8a96cef9-weights_ep16it70-0.68911_loss0.9988_1.npy\n",
      "Probabilities saved as: probs/logs-circor2_ar_byola.AR_BYOLA_8a96cef9-weights_ep16it70-0.68911_loss0.9988_2.npy\n"
     ]
    }
   ],
   "source": [
    "! bash ../bat/byola_ftcircor.sh 2 1 42"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "This resulted in weighted_accuracy: 0.55111 and UAR: 0.58932.\n",
    "\n",
    "The results are stored in results/circor-scores.csv."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>representation</th>\n",
       "      <th>task</th>\n",
       "      <th>wacc</th>\n",
       "      <th>uar</th>\n",
       "      <th>r_Present</th>\n",
       "      <th>r_Unknown</th>\n",
       "      <th>r_Absent</th>\n",
       "      <th>weight_file</th>\n",
       "      <th>run_id</th>\n",
       "      <th>report</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>M2D</td>\n",
       "      <td>circor2</td>\n",
       "      <td>0.828889</td>\n",
       "      <td>0.706536</td>\n",
       "      <td>0.933333</td>\n",
       "      <td>0.352941</td>\n",
       "      <td>0.833333</td>\n",
       "      <td>../m2d_vit_base-80x608p16x16-220930-mr7/checkp...</td>\n",
       "      <td>circor2_ar_m2d.AR_M2D_2b278ae7</td>\n",
       "      <td>Finetuning circor2_ar_m2d.AR_M2D_2b278ae7- on ...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>BYOLA</td>\n",
       "      <td>circor2</td>\n",
       "      <td>0.551111</td>\n",
       "      <td>0.589317</td>\n",
       "      <td>0.533333</td>\n",
       "      <td>0.705882</td>\n",
       "      <td>0.528736</td>\n",
       "      <td>external/byol_a/pretrained_weights/AudioNTT202...</td>\n",
       "      <td>circor2_ar_byola.AR_BYOLA_8a96cef9</td>\n",
       "      <td>Finetuning circor2_ar_byola.AR_BYOLA_8a96cef9-...</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "  representation     task      wacc       uar  r_Present  r_Unknown  r_Absent  \\\n",
       "0            M2D  circor2  0.828889  0.706536   0.933333   0.352941  0.833333   \n",
       "1          BYOLA  circor2  0.551111  0.589317   0.533333   0.705882  0.528736   \n",
       "\n",
       "                                         weight_file  \\\n",
       "0  ../m2d_vit_base-80x608p16x16-220930-mr7/checkp...   \n",
       "1  external/byol_a/pretrained_weights/AudioNTT202...   \n",
       "\n",
       "                               run_id  \\\n",
       "0      circor2_ar_m2d.AR_M2D_2b278ae7   \n",
       "1  circor2_ar_byola.AR_BYOLA_8a96cef9   \n",
       "\n",
       "                                              report  \n",
       "0  Finetuning circor2_ar_m2d.AR_M2D_2b278ae7- on ...  \n",
       "1  Finetuning circor2_ar_byola.AR_BYOLA_8a96cef9-...  "
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import pandas as pd\n",
    "\n",
    "pd.read_csv('results/circor-scores.csv')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "ar",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.18"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
